package cn.com.xf.dao.impl;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import cn.com.xf.dao.TblSiteCompanyDAO;
import cn.com.xf.dao.support.XFSqlMapClientDaoSupport;
import cn.com.xf.domain.TblSiteCompany;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

@Repository
public class TblSiteCompanyDAOImpl extends XFSqlMapClientDaoSupport implements TblSiteCompanyDAO {

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table TBL_SITE_COMPANY
	 * @ibatorgenerated  Tue Jul 07 14:50:55 CST 2015
	 */
	public TblSiteCompanyDAOImpl() {
		super();
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table TBL_SITE_COMPANY
	 * @ibatorgenerated  Tue Jul 07 14:50:55 CST 2015
	 */
	public int deleteByPrimaryKey(BigDecimal id) {
		TblSiteCompany key = new TblSiteCompany();
		key.setId(id);
		int rows = getSqlMapClientTemplate().delete(
				"TBL_SITE_COMPANY.ibatorgenerated_deleteByPrimaryKey", key);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table TBL_SITE_COMPANY
	 * @ibatorgenerated  Tue Jul 07 14:50:55 CST 2015
	 */
	public void insert(TblSiteCompany record) {
		getSqlMapClientTemplate().insert(
				"TBL_SITE_COMPANY.ibatorgenerated_insert", record);
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table TBL_SITE_COMPANY
	 * @ibatorgenerated  Tue Jul 07 14:50:55 CST 2015
	 */
	public void insertSelective(TblSiteCompany record) {
		getSqlMapClientTemplate().insert(
				"TBL_SITE_COMPANY.ibatorgenerated_insertSelective", record);
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table TBL_SITE_COMPANY
	 * @ibatorgenerated  Tue Jul 07 14:50:55 CST 2015
	 */
	public TblSiteCompany selectByPrimaryKey(BigDecimal id) {
		TblSiteCompany key = new TblSiteCompany();
		key.setId(id);
		TblSiteCompany record = (TblSiteCompany) getSqlMapClientTemplate()
				.queryForObject(
						"TBL_SITE_COMPANY.ibatorgenerated_selectByPrimaryKey",
						key);
		return record;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table TBL_SITE_COMPANY
	 * @ibatorgenerated  Tue Jul 07 14:50:55 CST 2015
	 */
	public int updateByPrimaryKeySelective(TblSiteCompany record) {
		int rows = getSqlMapClientTemplate().update(
				"TBL_SITE_COMPANY.ibatorgenerated_updateByPrimaryKeySelective",
				record);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table TBL_SITE_COMPANY
	 * @ibatorgenerated  Tue Jul 07 14:50:55 CST 2015
	 */
	public int updateByPrimaryKeyWithBLOBs(TblSiteCompany record) {
		int rows = getSqlMapClientTemplate().update(
				"TBL_SITE_COMPANY.ibatorgenerated_updateByPrimaryKeyWithBLOBs",
				record);
		return rows;
	}

	/**
	 * This method was generated by Apache iBATIS ibator. This method corresponds to the database table TBL_SITE_COMPANY
	 * @ibatorgenerated  Tue Jul 07 14:50:55 CST 2015
	 */
	public int updateByPrimaryKeyWithoutBLOBs(TblSiteCompany record) {
		int rows = getSqlMapClientTemplate().update(
				"TBL_SITE_COMPANY.ibatorgenerated_updateByPrimaryKey", record);
		return rows;
	}

	@Override
	public TblSiteCompany selectByType(String type) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("type", type);
		return (TblSiteCompany) getSqlMapClientTemplate().queryForObject(
				"TBL_SITE_COMPANY.ibatorgenerated_selectByType", map);
	}

}